/**
 * Created by CHENED2 on 8/13/2015.
 */
var request = require('request');
var cheerio = require('cheerio');
var async = require('async');
var mkdirp = require('mkdirp');
var fs = require('fs');
request('http://list.jd.com/list.html?cat=1315%2C1343%2C9719&go=0',function(error, response, body){
       if(!error && response.statusCode == 200){
           //console.log(body);
            var $ = cheerio.load(body);
            var items = $('div.p-name a em');
            //var items = $('div.gl-i-wrap.j-sku-item');
            for(var item in items){
                if(!isNaN(parseInt(item,10))){
                //    console.log(item);
                    console.log('xxx------');
                    //console.log(items[item].children[7].children[1].children[1].children[0].data);
                    console.log(items[item].children[0].data);
                }

            }
        }
    });



